#!/bin/bash
for domain in w9.101 w9.102 w9.103 w9.104 w9.105;
do
sz=`virsh list |grep $domain |grep -c running`
if [[ sz -eq 0 ]];then
IP=192.168.${domain:1}
guestmount -d $domain -m /dev/sda2 /mnt
#rm -f /mnt/etc/udev/rules.d/70-persistent-net.rules
sed -i "s/IPADDR=192.168.5.132/IPADDR=$IP/" /mnt/etc/sysconfig/network-scripts/ifcfg-eth0
umount /mnt
fi
done

